Enable ODBC Build On Linux - #160
Merged
Merged
Conversation
alinaliBQ
force-pushed
the
linux-ci-build-new
branch
from
March 12, 2026 19:26
d4e5463 to
8ac65b3
Compare
alinaliBQ
marked this pull request as ready for review
March 12, 2026 19:33
alinaliBQ
force-pushed
the
linux-ci-build-new
branch
from
March 12, 2026 19:35
8ac65b3 to
2afc5fd
Compare
justing-bq
reviewed
Mar 13, 2026
| - name: Register Flight SQL ODBC Driver | ||
| run: | | ||
| sudo cpp/src/arrow/flight/sql/odbc/install/mac/install_odbc.sh $(pwd)/build/cpp/${{ matrix.build-type }}/libarrow_flight_sql_odbc.dylib | ||
| sudo cpp/src/arrow/flight/sql/odbc/install/unix/install_odbc.sh $(pwd)/build/cpp/${{ matrix.build-type }}/libarrow_flight_sql_odbc.dylib |
There was a problem hiding this comment.
Don't we want this same "Register Flight SQL ODBC Driver" section for linux as well?
Author
There was a problem hiding this comment.
This section is inside compose.yaml:
Lines 531 to 535 in 2afc5fd
Because Linux docker file has the test sessions etc inside the docker command, I added ODBC registration at the same place
Next: resolve the string conversion issues in tests. Write simple helper function to convert wstring (or wchar_t*) to `std::vector<SQLWCHAR>` should solve the issue. Disable ODBC test build on Linux - Building Linux test in ODBC will be in a separate PR - Reducing dockerfile will be in a separate PR Resolve sqlucode.h build issue * Doesn't impact macOS. Check CI if it impacts Windows ODBC. Resolve `sign-compare` warnings - Need to have same type during comparison. - Now `Built target arrow-odbc-spi-impl-test` is successful. Add forward function header Resolve system.cc build errors Still have some wsigns stuff to fix later. In-progress fix with unicode issues on system_dsn.cc TODO - still need to make the `ToSqlWCharPtr` function safe. Fix Linux build errors with configuration.cc * Finish fixing wchar related build errors at configuration.cc * Still have errors at `system_dsn.cc` Remove some log messages This partially reverts commit 568f72d. All tests on macOS passing locally. In-progress fix read SQLWCHAR string In-progress Fix ODBC Build errors on Linux - Mar2 week - Add `[[fallthrough]];` to indicate intentional fallthrough. - Add `default` handling case. - Add casts for `record_number` compares Attempt to fix Windows build from odbc_statement.cc header change In-progress Fix ODBC Build errors on Linux - remove `std::move(options);` - Remove `boost` library install and add boost::headers to cmake lists, which resolves a lot of the boost issues I think - Continue on Monday. Add wrappers for `reinterpret_cast<LPCWSTR>` This was causing an issue on Linux Replace `boost::lexicographical_compare` with `std::lexicographical_compare` Restore boost usages and add `BOOST_NO_CXX98_FUNCTION_BASE` Undo Set build level warning to production It didn't resolve the build errors related to boost on Linux (or any other build errors) Set build level warning to production * If this acts as a workaround for boost, then we don't have to redo boost In-progress Fix the `LPCWSTR` convert error on Linux - Plus formatting fix - Plus build fix for casting More boost disables I think the solution would be to replace boost completely. Now the build works on macOS. Continue in-progress fix odbc build Temp boost disables In-progress fix ODBC build - Add `unixodbc-dev` to dockerfile - There are changes to macOS static build PR that I will need to incorporate back to `apache-odbc` later Enable ODBC mac and Windows in case of errors Enable ODBC build on Linux Add ODBC=ON to dockerfile Fix `arm64` cannot found error from typo Add `DOCKER_VOLUME_PREFIX` and other environment settings Add Linux docker to `compose.yaml` Disable mac and Windows ODBC for faster build More disable Draft ODBC Linux implementation Comment out non-ODBC items
* remove ODBC dockerfile as it is not needed. * in-progress of register ODBC * move unix odbc registration script to common place
* resolve the issue of ODBC APIs not exported on Linux
alinaliBQ
force-pushed
the
linux-ci-build-new
branch
from
March 13, 2026 18:47
2afc5fd to
126bbe7
Compare
Trying to figure out why `Set(FlightSqlConnection::DISABLE_CERTIFICATE_VERIFICATION` just cannot pass default values. Somehow Add configuration.cc logs In-progress implement unicode support conversion [In-progress] One change that (somehow) enables DBTLabs Flight SQL connection - using `ENVID` as `static constexpr` enabled the environmentid variable to be read properly. Then other custom keys like `abc` and `Description` also started to work. Fixes the issue of strings too
alinaliBQ
commented
Mar 19, 2026
| @@ -40,7 +40,16 @@ if [ ! -f "$ODBC_64BIT" ]; then | |||
| exit 1 | |||
| fi | |||
|
|
|||
alinaliBQ
commented
Mar 19, 2026
Comment on lines
+531
to
+535
| command: > | ||
| /bin/bash -c " | ||
| /arrow/ci/scripts/cpp_build.sh /arrow /build && | ||
| sudo /arrow/cpp/src/arrow/flight/sql/odbc/install/unix/install_odbc.sh /usr/local/lib/libarrow_flight_sql_odbc.so && | ||
| /arrow/ci/scripts/cpp_test.sh /arrow /build" |
Author
There was a problem hiding this comment.
ODBC build, registration, and test is here
alinaliBQ
commented
Mar 19, 2026
Comment on lines
17
to
+19
|
|
||
| // flight_sql_connection.h needs to be included first due to conflicts with windows.h | ||
| #include "arrow/flight/sql/odbc/odbc_impl/flight_sql_connection.h" |
alinaliBQ
commented
Mar 19, 2026
Comment on lines
+138
to
+139
| // Read keys before reading DSN. This is a workaround to unixodbc driver manager | ||
| // unable to read DSN keys |
Author
There was a problem hiding this comment.
todo for myself change the comment
alinaliBQ
commented
Mar 19, 2026
|
|
||
| #pragma once | ||
|
|
||
| #define BOOST_NO_CXX98_FUNCTION_BASE // ARROW-17805 |
alinaliBQ
commented
Mar 19, 2026
| } | ||
|
|
||
| // Reset GetData value offsets. | ||
| if (num_binding_ != get_data_offsets_.size() && reset_get_data_) { |
Author
There was a problem hiding this comment.
todo use const cast c++ style cast
alinaliBQ
commented
Mar 19, 2026
| EXPECT_FALSE(std::wstring(message).empty()); | ||
| } | ||
|
|
||
| // TODO: verify that `SQLGetConnectOption` is not required by Excel. |
Author
There was a problem hiding this comment.
removed comment that should have been removed before
alinaliBQ
commented
Mar 19, 2026
Comment on lines
261
to
263
| endif() | ||
|
|
||
| add_test_case(${REL_TEST_NAME} |
justing-bq
approved these changes
Mar 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements basic Linux build and unicode support is enabled. Tested locally and verified the driver can connect to DBT Labs via
isql.docker-composefor Flight SQL ODBCboost::lexicographical_comparewithstd::lexicographical_compareSetAttributeSQLWCHAR